/*
 * @Author: anxia.ack anchenkai@come-future.com
 * @Date: 2025-03-28 17:01:36
 * @LastEditors: anxia.ack anchenkai@come-future.com
 * @LastEditTime: 2025-03-28 17:51:34
 * @FilePath: /free-learning/src/api/system/counselor-audit/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from "@/utils/request";
import type {
  ConsultantAudit,
  ConsultantAuditPageQuery,
  ConsultantAuditPageVO,
  ConsultantAuditVO,
} from "./type";

const COUNSELOR_AUDIT_BASE_URL = "/api/v1/consultant/audit";
/**
 * 分页查询审核咨询师
 * @param params 查询参数
 */
export const pageQuery = (params: Partial<ConsultantAuditPageQuery>) => {
  return request<any, MyPageResult<ConsultantAuditPageVO>>({
    url: `${COUNSELOR_AUDIT_BASE_URL}/page`,
    method: "post",
    data: params,
  });
};

/**
 * 审核咨询师
 * @param params 审核参数
 */
export const auditConsultant = (params: Partial<ConsultantAudit>) => {
  return request<boolean>({
    url: `${COUNSELOR_AUDIT_BASE_URL}/update-status`,
    method: "post",
    data: params,
  });
};

/**
 * 获取咨询师审核历史
 * @param id 咨询师ID
 */
export const getConsultantAuditHistory = (id: number) => {
  return request<any, ConsultantAudit[]>({
    url: `${COUNSELOR_AUDIT_BASE_URL}/history/${id}`,
    method: "get",
  });
};

/**
 * 查询审核师资料
 * @param id 咨询师ID
 */
export const getConsultantAudit = (id: number) => {
  return request<any, ConsultantAuditVO>({
    url: `${COUNSELOR_AUDIT_BASE_URL}/get-consultant-data/${id}`,
    method: "get",
  });
};
